package zhousi;
import java.util.Arrays;
import java.util.Scanner;
public class learn2 {
    public static void main(String[] args) {
        //int num[]={4,25,89,100,11};
        int num[] = {1, 2, 3, 4, 5};
        //升序排序
        Arrays.sort(num);
        System.out.println(Arrays.toString(num));
        //查找元素的下标
        int index=Arrays.binarySearch(num,2);
        System.out.println(index);
        //把上面的数组全部赋值为6
            Arrays.fill(num,6);
            System.out.println(Arrays.toString(num));
        //创建一个新数组，里面元素全部为6
        int suzu[]=Arrays.copyOf(num, 6);
        for (int i = 0; i < suzu.length; i++) {
            System.out.print(suzu[i]);}

    }
    }
